﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ECare.BUS;
using ECare.BUS.Data;

namespace ECare.Client.controls
{
    public partial class ucOutInfo : UserControl
    {
        public ucOutInfo()
        {
            InitializeComponent();
        }

        public PlanOutInfo CurrentOutInfo { get; set; }


        public void LoadInformation()
        {
            this.lblcode.Text = string.Format(this.lblcode.Text,CurrentOutInfo.plan_out_code);
            this.lblDate.Text = string.Format(this.lblDate.Text, CurrentOutInfo.plan_out_date);
            this.lblProduceDate.Text = string.Format(this.lblProduceDate.Text,CurrentOutInfo.plan_produce_date);

            this.lblIsActive.Text = string.Format(this.lblIsActive.Text, CurrentOutInfo.plan_isactive.ToString());
            this.lblCheckStatus.Text = string.Format(this.lblCheckStatus.Text,CurrentOutInfo.plan_out_check_status);

            this.lblRemark.Text = string.Format(this.lblRemark.Text,CurrentOutInfo.plan_remark);

            formula_id.DataSource = FormulaHelper.GetFormulaInfos();
            formula_id.DisplayMember = "FormulaName";
            formula_id.ValueMember = "FormulaId";






            this.grdPlans.DataSource = PlanHelper.GetPlansByOutId(CurrentOutInfo.plan_out_id);
        }

    }
}
